<?php

Yii::import('zii.widgets.CPortlet');
Yii::import('application.modules.adsPartners.models.AdsPartners');
Yii::import('application.modules.setting.models.Setting');

class Left extends CPortlet {

    public function getUrl() {
        $criteria = new CDbCriteria(array(
            'order' => 'create_time DESC',
        ));
        $criteria->condition = 'category_id =' . AdsPartners::LINK;
        $model = AdsPartners::model()->findAll($criteria);
        return $model;
    }

    public function getNick() {
        return Setting::model()->findByAttributes(array('key' => 'yahoo'));
    }

    public function getPhone() {
        return Setting::model()->findByAttributes(array('key' => 'phone'));
    }

    protected function renderContent() {
        $this->render('left');
    }

}

?>